#!/usr/bin/env python
# encoding: utf-8
"""
@author: shura
@position: saber
@contact: 2209032305@qq.com
@file: pdd.py
@time: 2019/2/22 10:30
@desc:
"""
a = list(map(int,input().split()))
max_r = []
min_r = []
import heapq
for x in a:
    if len(max_r) < 3:
        heapq.heappush(max_r,x)
    else:
        if x > max_r[0]:
            heapq.heappop(max_r)
            heapq.heappush(max_r,x)
    if len(min_r) < 2:
        heapq.heappush(min_r,-x)
    else:
        if -x > min_r[0]:
            heapq.heappop(min_r)
            heapq.heappush(min_r,-x)
res = max(max_r[0]*max_r[1]*max_r[2],max(max_r)*-min_r[0]*-min_r[1])
print(res)